<template>
<slot :controller="controller" :store="store" :model="model" >
        <div :class="classNames" :id="controlID">
            <slot name="container1Container" :controller="controller" :store="store" :model="model" >
            <AppStandardContainer 
                name="container1"
                v-show="store.layoutModelDetails?.container1?.visible"
                :isMultiContainer="false"
                :layoutModelDetails="store.layoutModelDetails">
                <template #container4>
                    <slot name="container4Container" :controller="controller" :store="store" :model="model" >
                    <AppStandardContainer 
                        name="container4"
                        v-show="store.layoutModelDetails?.container4?.visible"
                        :isMultiContainer="false"
                        :layoutModelDetails="store.layoutModelDetails">
                        <template #field_image>
                            <slot name="field_image" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppFieldImageDynamic
                                name="field_image"
                                :value="store.layoutData.field_image"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails"/>
                            </slot>
                        </template>
                        <template #field_text_dynamic>
                            <slot name="field_text_dynamic" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetText
                                name="field_text_dynamic"
                                :value="store.layoutData.field_text_dynamic"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails"/>
                            </slot>
                        </template>
                    </AppStandardContainer>
                    </slot>
                </template>
                <template #container2>
                    <slot name="container2Container" :controller="controller" :store="store" :model="model" >
                    <AppStandardContainer 
                        name="container2"
                        v-show="store.layoutModelDetails?.container2?.visible"
                        :isMultiContainer="false"
                        :layoutModelDetails="store.layoutModelDetails">
                        <template #static_label1>
                            <slot name="static_label1" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetText 
                                name="static_label1"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails" />
                            </slot>
                        </template>
                        <template #field_text_dynamic1>
                            <slot name="field_text_dynamic1" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetText
                                name="field_text_dynamic1"
                                :value="store.layoutData.field_text_dynamic1"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails"/>
                            </slot>
                        </template>
                    </AppStandardContainer>
                    </slot>
                </template>
                <template #container7>
                    <slot name="container7Container" :controller="controller" :store="store" :model="model" >
                    <AppStandardContainer 
                        name="container7"
                        v-show="store.layoutModelDetails?.container7?.visible"
                        :isMultiContainer="false"
                        :layoutModelDetails="store.layoutModelDetails">
                        <template #static_label3>
                            <slot name="static_label3" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetText 
                                name="static_label3"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails" />
                            </slot>
                        </template>
                        <template #field_text_dynamic2>
                            <slot name="field_text_dynamic2" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetText
                                name="field_text_dynamic2"
                                :value="store.layoutData.field_text_dynamic2"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails"/>
                            </slot>
                        </template>
                    </AppStandardContainer>
                    </slot>
                </template>
                <template #container8>
                    <slot name="container8Container" :controller="controller" :store="store" :model="model" >
                    <AppStandardContainer 
                        name="container8"
                        v-show="store.layoutModelDetails?.container8?.visible"
                        :isMultiContainer="false"
                        :layoutModelDetails="store.layoutModelDetails">
                        <template #static_label4>
                            <slot name="static_label4" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetText 
                                name="static_label4"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails" />
                            </slot>
                        </template>
                        <template #field_text_dynamic4>
                            <slot name="field_text_dynamic4" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetText
                                name="field_text_dynamic4"
                                :value="store.layoutData.field_text_dynamic4"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails"/>
                            </slot>
                        </template>
                    </AppStandardContainer>
                    </slot>
                </template>
                <template #container6>
                    <slot name="container6Container" :controller="controller" :store="store" :model="model" >
                    <AppStandardContainer 
                        name="container6"
                        v-show="store.layoutModelDetails?.container6?.visible"
                        :isMultiContainer="false"
                        :layoutModelDetails="store.layoutModelDetails">
                        <template #field_text_dynamic5>
                            <slot name="field_text_dynamic5" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetText
                                name="field_text_dynamic5"
                                :value="store.layoutData.field_text_dynamic5"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails"/>
                            </slot>
                        </template>
                        <template #field_text_dynamic3>
                            <slot name="field_text_dynamic3" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetText
                                name="field_text_dynamic3"
                                :value="store.layoutData.field_text_dynamic3"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails"/>
                            </slot>
                        </template>
                        <template #field_text_dynamic6>
                            <slot name="field_text_dynamic6" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetText
                                name="field_text_dynamic6"
                                :value="store.layoutData.field_text_dynamic6"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                :layoutModelDetails="store.layoutModelDetails"/>
                            </slot>
                        </template>
                        <template #button_calluilogic1>
                            <slot name="button_calluilogic1" :controller="controller" :store="store" :model="model"  :actions="{ handleComponentAction }">
                            <AppPresetButton
                                name="button_calluilogic1"
                                :loading="store.loadingHelper.isLoading"
                                :layoutModelDetails="store.layoutModelDetails"
                                :value="store.layoutData.button_calluilogic1"
                                @component-action="(actionParam: IEvent<string>) => { handleComponentAction(controller, actionParam) }"
                                />
                            </slot>
                        </template>
                    </AppStandardContainer>
                    </slot>
                </template>
            </AppStandardContainer>
            </slot>
        </div>
</slot>
</template>
<script setup lang="ts">
// 基于template/src/widgets/{{appEntities}}/{{ctrls@PANEL}}-panel/{{spinalCase ctrl.codeName}}-panel-base.vue.hbs生成

import { AppCtrlPos, AppScrollContainer, AppSimpleFlexContainer, AppStandardContainer, AppTabPanel, AppTabPage } from '@components/layout-element/structure';
import { IContext, IParam, createUUID, ILoadingHelper, ICtrlDataAction,IViewCtx, IEvent } from "@/core";
import { useProps, useBasic, useController } from './listpanel-Panel-hook';
import { PanelActionType, IPanelAbility, IPanelStore, IViewLogicInput } from "@/core/interface";

// 输入参数
const props = defineProps(useProps());

// 基础数据
const { controlID, getClassNames, model ,useNavParamsBind, useEventBind, handleComponentAction } = useBasic(props);

const emit = defineEmits<{
    (event: 'ctrl-action', name: string, action: PanelActionType, data: IParam[]): void;
    (event: 'ctrl-init', name: string, data: IPanelAbility): void;
    (event: 'ctrl-destroy', name: string, data: IParam): void;
}>();

const evt = useEventBind(emit);
//  部件样式名
const classNames = computed(() => {
  return getClassNames(props);
});

//  面板部件控制器
const controller = useController(props, evt, { controlID });

useNavParamsBind(controller, props);

const store: IPanelStore = controller.getStore();

onMounted(() => {
    controller.ctrlMounted();
});
onUnmounted(() => {
    controller.ctrlDestroy();
})
</script>